package ch05.ex3_2_1_CreatingSequences

/**
 * Created by caozp-ytcyc2007 on 2017/5/26.
 */

fun main(args: Array<String>) {
    val naturalNumbers = generateSequence(0) { it + 1 }
    val numbersTo100 = naturalNumbers.takeWhile { it <= 100 }
    println(numbersTo100.sum())
}